package cn.baiweigang.uu.enums;

public enum OffsetEnum {

    OPEN("open","开仓"),
    CLOSE("close","平仓"),
    ;

    private String code;
    private String desc;

    OffsetEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }
    public static OffsetEnum byCode(String code){
        OffsetEnum[] directionEnums= OffsetEnum.values();
        for (int i=0;i< directionEnums.length;i++){
            if (directionEnums[i].getCode().equalsIgnoreCase(code)){
                return directionEnums[i];
            }
        }
        return null;
    }
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
